package com.wzt.base.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Zenith
 */
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResponse {
    /**
      * 返回请求是否处理成功
      */
    private Boolean success = true;
    /**
     * 返回的信息
     */
    private String message = "";
    /**
     * 返回的数据
     */
    private Object data = null;

    public AjaxResponse setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public Boolean getSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }

    public AjaxResponse setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResponse setData(Object data) {
        this.data = data;
        return this;
    }

    public static AjaxResponse oneResponse() {
        return new AjaxResponse();
    }
}
